//
//  GoodsWithMessageTableViewCell.m
//  MyProject
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "GoodsWithMessageTableViewCell.h"

@implementation GoodsWithMessageTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.userImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_userImageView];
        self.userImageView.layer.cornerRadius = [UIScreen mainScreen].bounds.size.width/23;
        self.userImageView.clipsToBounds = YES;
        self.nameLable = [[UILabel alloc]init];
        [self.contentView addSubview:_nameLable];
        
        self.timeLable = [[UILabel alloc]init];
        [self.contentView addSubview:_timeLable];
        self.timeLable.font = [UIFont systemFontOfSize:12];
        self.timeLable.textColor = [UIColor grayColor];
        
        
        self.bigImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_bigImageView];
        
        self.messageLable = [[UILabel alloc]init];
        [self.contentView addSubview:_messageLable];
        self.messageLable.font = [UIFont systemFontOfSize:14];
        self.messageLable.numberOfLines = 0;
        [self.messageLable sizeToFit];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.userImageView.frame = CGRectMake(10, 10, 30, 30);
    self.nameLable.frame = CGRectMake(50, 10, 200, self.userImageView.bounds.size.height*2/3);
    self.timeLable.frame = CGRectMake(50, 10 + self.userImageView.bounds.size.height*2/3, 200, self.userImageView.bounds.size.height*2/3);
    self.bigImageView.frame = CGRectMake(0 ,50, self.contentView.bounds.size.width,self.contentView.bounds.size.width);
    self.messageLable.frame = CGRectMake(10, (50 + [UIScreen mainScreen].bounds.size.width)+10, [UIScreen mainScreen].bounds.size.width - 20, 20);
    [self.messageLable sizeToFit];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
